const FormatNumber = (num: number) => {
  if (!num) return ''
  let numString: string = num.toString()
  let unitArray: string[] = ['万', '亿']
  let unitGroup = numString.length / 4
  if (unitGroup > 2) {
    return (num / Math.pow(10000, 2)).toFixed(1) + unitArray[1]
  } else if (unitGroup > 1) {
    return (num / Math.pow(10000, 1)).toFixed(1) + unitArray[0]
  } else {
    return numString
  }
}
export default FormatNumber